Skip to content

Label segmentation masks with brush and polygon ​

In a segmentation dataset you mark the exact area of every object or defect, pixel by pixel. In this guide you outline an object with the polygon, paint one with the brush, tidy the edge with the eraser and check the result.

What you will learn

  • When to use the polygon and when the brush
  • How to paint one object with several strokes
  • How to correct a mask with the eraser
  • How to tell whether an image is normal or has an anomaly

Before you start

You need a segmentation dataset with images and at least one tag. The editor is described in Get to know the labeling editor.

1. Choose the polygon ​

The polygon is the quickest way to mark an object with a clear outline. Choose «Polygon» in the toolbar. The card next to it shows the tag the mask will get: choose another one there if the dataset has several.

Choose the polygon

2. Outline the object ​

Click point after point along the edge of the object. Close the outline by clicking the first point again: the area inside becomes a mask with the chosen tag. Esc drops an outline you have not closed yet.

Outline the object

3. Choose the brush ​

The brush suits irregular areas, such as a stain or a crack. Choose «Draw» and set «Brush size» in the card. «Instance mode» decides how strokes join: with «Stroke», every stroke is a mask of its own; with «Instance», strokes join into one mask until you start a new one with N.

Choose the brush

4. Paint the object ​

Drag over the area to paint it. Here, two strokes in «Instance» mode paint one biscuit as a single mask. Ctrl+Z undoes the last stroke.

Paint the object

5. Tidy the edge with the eraser ​

Choose «Erase» and drag over the paint that went past the edge of the object. The eraser removes paint from the masks without touching the image.

Tidy the edge with the eraser

6. Check the masks and the state of the image ​

The «Labels» panel lists each mask with its tag: change the tag there, hide the masks to look under them, or delete one. Above, «Anomaly» and «Normal» tell whether the image shows something to mark; a good image with nothing to paint is marked «Normal». An image with masks counts as reviewed.

Check the masks and the state of the image

Next steps ​

Recorded on Rosepetal release 1.8.15.